package service;

import dbutil.Dbconn;
import po.User;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

public class DELETES {
    private Model model;
    private Statement stat;
    private ResultSet rs;
    Dbconn s=new Dbconn();
    public void userSelect(int i){
        List users=new ArrayList();
        try {
            Connection conn=s.getConnection();
            String sql="delete from sysuser where UserId=?";
            PreparedStatement ps= conn.prepareStatement(sql);
            ps.setInt(1,i);
            ps.executeUpdate();
            User user;
            while(rs.next()){
                user=new User();
                user.setUserId(rs.getInt("UserId"));
                user.setLoginName(rs.getString("LoginName"));
                user.setLoginPwd(rs.getString("LoginPwd"));
                users.add(user);
            }

        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}


